package com.xujiang.imitationcompanypj.data.ui.base;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.etekcity.vesync.common.plus.ui.CPBaseActivity;
import com.flyco.systembar.SystemBarHelper;

/**
 * Created by xujiang on 2017/3/31.
 */

public abstract class BaseActivity extends CPBaseActivity {
    private boolean isStatusBarDark = true;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        beforeOnCreate();
        if (isStatusBarDark) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
                    && Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
                getWindow().setStatusBarColor(Color.BLACK);
            }
            SystemBarHelper.setStatusBarDarkMode(this);//设备系统状态栏图标为暗色,只对6.0以上生效
        }


    }

    /**
     * 子类onCreate之前调用
     */
    protected void beforeOnCreate() {
    }
}
